
import app.tools as tool
from app.tools.tab import TabWidgetItem


class TabPageBase(object):

    def __init__(self, tab, name):
        self.tab = tab
        self.name = name
        self.tab_widget_page = TabWidgetItem(self.tab.get_instance())
        self.tab_widget_page.value = self
        self.tab_widget_page.setObjectName(tool._from_utf8(self.name))
        self.tab_widget_page.resize(self.tab.size())

    def get_instance(self):
        return self.tab_widget_page